use serde::{Deserialize, Serialize};

#[derive(Serialize, Deserialize, Debug, Clone, Default, Eq, PartialEq)]
pub struct UserGroupType(u32);

impl UserGroupType {
    pub const SYSTEM: Self = UserGroupType(1);
    pub const NORMAL: Self = UserGroupType(2);

    pub fn as_u32(&self) -> u32 {
        self.0
    }
}

impl From<u32> for UserGroupType {
    fn from(value: u32) -> Self {
        UserGroupType(value)
    }
}

#[derive(Serialize, Deserialize, Debug, Clone, Default, Eq, PartialEq)]
pub struct UserGroup {
    pub user_group_id: String,
    pub user_group_type: UserGroupType,
    pub name: String,
    pub description: String,
}